﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace McMySkin_Installer
{
    public class NewForm2 : NewForm
    {
        private McSmallButton mcSmallButton1;
    
        public NewForm2()
        {
            InitializeComponent();
        }

        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NewForm2));
            this.mcSmallButton1 = new McMySkin_Installer.McSmallButton();
            this.SuspendLayout();
            // 
            // mcSmallButton1
            // 
            this.mcSmallButton1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("mcSmallButton1.BackgroundImage")));
            this.mcSmallButton1.Location = new System.Drawing.Point(802, 12);
            this.mcSmallButton1.Name = "mcSmallButton1";
            this.mcSmallButton1.Size = new System.Drawing.Size(40, 40);
            this.mcSmallButton1.TabIndex = 0;
            this.mcSmallButton1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.mcSmallButton1_MouseDown);
            // 
            // NewForm2
            // 
            this.ClientSize = new System.Drawing.Size(854, 480);
            this.Controls.Add(this.mcSmallButton1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.Location = new System.Drawing.Point(0, 0);
            this.Name = "NewForm2";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Paint += new System.Windows.Forms.PaintEventHandler(this.Render);
            this.ResumeLayout(false);

        }

        private void Render(object sender, PaintEventArgs e)
        {
            Bitmap dirt = Properties.Resources.dirt;
            Graphics g = e.Graphics;

            int width = this.ClientSize.Width;
            int height = this.ClientSize.Height;

            using (TextureBrush tb = new TextureBrush(dirt))
            {
                g.FillRectangle(tb, this.ClientRectangle);
            }

            g.DrawString("萌萌骚应用程序", new Font("微软雅黑", 15), new SolidBrush(Color.White), new RectangleF(10, 10, 500, 30));

            //半透明部分
            using (SolidBrush brush = new SolidBrush(Color.FromArgb(150, 0, 0, 0)))
            {
                g.FillRectangle(brush, new Rectangle(0, 80, width, height - 160));
            }

            //渐变部分
            using (LinearGradientBrush gradientBrush = new LinearGradientBrush(new Rectangle(0,80,width,30),Color.Black,Color.Transparent,LinearGradientMode.Vertical))
            {
                g.FillRectangle(gradientBrush, new Rectangle(0, 80, width, 30));
            }
            
            using (LinearGradientBrush gradientBrush = new LinearGradientBrush(new Rectangle(0, height - 110, width, 30), Color.Transparent, Color.Black, LinearGradientMode.Vertical))
            {
                g.FillRectangle(gradientBrush, new Rectangle(0, height - 110, width, 30));
            }
            
        }

        private void mcSmallButton1_MouseDown(object sender, MouseEventArgs e)
        {
            this.Close();
        }
    }
}
